﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;

#nullable disable

namespace SystemHYS.Infrstructre.Migrations
{
    /// <inheritdoc />
    public partial class 生产领料 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "ProductionRequisition",
                columns: table => new
                {
                    productionRequisitionId = table.Column<int>(type: "integer", nullable: false)
                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
                    requisitionNumber = table.Column<string>(type: "text", nullable: false),
                    requisitionName = table.Column<string>(type: "text", nullable: false),
                    requisitionDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
                    requisitionPerson = table.Column<string>(type: "text", nullable: false),
                    workOrderName = table.Column<string>(type: "text", nullable: false),
                    workOrderOrder = table.Column<string>(type: "text", nullable: false),
                    taskName = table.Column<string>(type: "text", nullable: false),
                    taskOrder = table.Column<string>(type: "text", nullable: false),
                    processRoute = table.Column<string>(type: "text", nullable: false),
                    processName = table.Column<string>(type: "text", nullable: false),
                    remark = table.Column<string>(type: "text", nullable: false),
                    state = table.Column<int>(type: "integer", nullable: false),
                    Isdel = table.Column<bool>(type: "boolean", nullable: false),
                    AddName = table.Column<string>(type: "text", nullable: true),
                    AddTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
                    UpdateName = table.Column<string>(type: "text", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
                    DelectName = table.Column<string>(type: "text", nullable: true),
                    DelectTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_ProductionRequisition", x => x.productionRequisitionId);
                });

            migrationBuilder.CreateTable(
                name: "RawMaterialProduction",
                columns: table => new
                {
                    RawMaterialProductionId = table.Column<int>(type: "integer", nullable: false)
                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
                    RawMaterialId = table.Column<int>(type: "integer", nullable: false),
                    productionRequisitionId = table.Column<int>(type: "integer", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_RawMaterialProduction", x => x.RawMaterialProductionId);
                });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "ProductionRequisition");

            migrationBuilder.DropTable(
                name: "RawMaterialProduction");
        }
    }
}
